from django.contrib import admin
from django.urls import path, include
from django.shortcuts import HttpResponse
from django.db import connection
from user import views


def mysql_view(request):
    # 获取对象
    cursor = connection.cursor()
    # 拿到对象后执行sql语句
    cursor.execute('select * from tb2')
    # 获取所有的数据
    rows = cursor.fetchall()
    # 追历查询到的数据
    for row in rows:
        print(row)
    return HttpResponse('查找成功')


urlpatterns = [
    path('admin/', admin.site.urls),
    # path('mysql_test/', mysql_view, name='msyql_test'),
    # path('add_user/', views.add_user, name='add_user'),
    # path('get_users/', views.get_users, name='get_users'),
    # path('get_users_by_id/', views.get_users_by_id, name='get_users_by_id'),
    # path('get_user/', views.get_user, name='get_user'),
    # path('update_user/', views.update_user, name='update_user'),
    # path('delete_user/', views.delete_user, name='delete_user'),

    path('book_display_app/', include('bookDisplay.urls')),
    path('user/', include('user.urls')),
]
